
var myUrlHolder = new Object();

function submitProfileForm() {
	$.post(myUrlHolder.editProfile, {
		firstName : $('#firstName').val(),
		lastName : $('#lastName').val(),
		address : $('#newAddress').val(),
		phone : $('#newPhone').val(),
		panNo : $('#newPan').val()
	}, function(response) {
		if (response != null) {
			alert('Success! Record has been added.');
			$('#profileForm').show();
			$('#editProfileForm').hide();
			$('#editButton').removeAttr('disabled');
		} else {
			alert('Failure! An error has occurred!');
		}
	});
}

function loadProfile() {
	$.post(myUrlHolder.loadProfile, {
		pan : '1'
	},
			function(response){
		
		$('#fname').val(response.firstName);
		$('#lname').val(response.lastName);
		$('#address').val(response.address);
		$('#phone').val(response.phone);
		$('#pan').val(response.panNo);
		
		$('#firstName').val(response.firstName);
		$('#lastName').val(response.lastName);
		$('#newAddress').val(response.address);
		$('#newPhone').val(response.phone);
		$('#newPan').val(response.panNo);
		
	});
};
